import request from '@/utils/request'
// 查询物联用户单位列表
export const getleftlistapi = () => request.get('core/iot/config/device/company/list')
// 查询物联通道下拉框数据
export const gettongdaoxialaapi = params => request.get('/core/iot/config/channel/combo-items',{params})
// 分页查询物联设备列表
export const gettablelistapi = params => request.get('/core/iot/config/device/page-list', { params })
// 查询物联表计型号列表
export const getwangguanapi = params => request.get('/core/iot/config/meter-type/list', { params })
// 创建网关设备
export const postwangguanapi = data => request.post(`/core/iot/config/device/gateway?channelTag=${data.channelTag}&companyNo=${data.companyNo}&deviceModel=${data.deviceModel}&deviceName=${data.deviceName}&deviceTag=${data.deviceTag}&enabled=${data.enabled}`)
// 创建表计设备
export const postbiaojiapi = data => request.post(`/core/iot/config/device/meter?ct=${data.ct}&deviceModel=${data.deviceModel}&deviceName=${data.deviceName}&deviceTag=${data.deviceTag}&enabled=${data.enabled}&gatewayId=${data.gatewayId}&pt=${data.pt}`)
// 删除物联设备
export const deletwulianapi = data => request.post(`/core/iot/config/device/delete?deviceId=${data.deviceId}`)
// 创建独立通讯表计
export const posttongxunapi=data=>request.post(`/core//iot/config/device/communication-meter?channelTag=${data.channelTag}&companyNo=${data.companyNo}&deviceModel=${data.deviceModel}&deviceName=${data.deviceName}&deviceTag=${data.deviceTag}&enabled=${data.enabled}&pt=${data.pt}&ct=${data.ct}`)
// 修改物联设备
export const putwulianapi = data => request.post(`/core/iot/config/device/put?ct=${data.ct}&pt=${data.pt}&deviceId=${data.deviceId}&deviceName=${data.deviceName}&deviceTag=${data.deviceTag}`)
// 启用物联设备
export const postqiyongapi = data => request.post(`/core/iot/config/device/enable?deviceId=${data.deviceId}`)
// 禁用物联设备
export const postjingyongapi = data => request.post(`/core/iot/config/device/disable?deviceId=${data.deviceId}`)
// 查询物联设备关联测点设备列表
export const getguanlianshebeiapi = params => request.get('/core/iot/config/device/relation-device/list', { params })
// 查询设备对应列表，树状图还没写好，目前参数写死
export const getshebeilistapi = data => request.get(`/core/iot/config/device-item/list?deviceId=${data.deviceId}&itemGroup=${data.itemGroup}`)
// 批量删除/删除
export const dellistapi = data => request.post(`/core/iot/config/device-item/delete?id=${data.id}`)
// 上移设备测点
export const postshangyiapi = data => request.post(`/core/iot/config/device-item/move-up?id=${data.id}`)
// 下移设备测点
export const postxiayiapi = data => request.post(`/core/iot/config/device-item/move-down?id=${data.id}`)
// 
export const getyanzhongapi = () => request.get('/core/dictionary/combo-item/list?dictType=EventLevel')
// 删除枚举
export const delmeijucedianapi = data => request.post(`/core/iot/config/device-item/enum-item/delete?enumValue=${data.enumValue}&id=${data.id}`)
// 添加枚举
export const pustmeijucedianapi = data => request.post(`/core/iot/config/device-item/enum-item/put?enumName=${data.enumName}&enumValue=${data.enumValue}&id=${data.id}`)
// 批量修改
export const putpiliangapi = data => request.post('/core/iot/config/device-item/batch-edit', data)
// 获取批量修改测点模板
export const getpicedianlistapi = data => request.get(`/core/iot/config/item-template/batch-edit/list?id=${data}`)
// 获取遥测事件下拉框
export const getyaoxinxialaapi = () => request.get('/core/iot/config/event-type/discrete/combo-items')
// 添加枚举
export const putmeijuapi = data => request.post('/core/iot/config/item-template/enum-item/put', { ...data, isParams: true })
// 删除枚举
export const delmeijuapi = data => request.post('/core/iot/config/item-template/enum-item/delete', { ...data, isParams: true })
// 批量修改接口
export const postpiliangputapi = data => request.post('/core/iot/config/item-template/batch-edit', data)
// 批量修改设备测点
export const postpixiucedianapi = data => request.get(`/core/iot/config/device-item/batch-edit/list?id=${data}`)
// 获取遥信下拉
export const getyaoxinxialapi = () => request.get('/core/dictionary/combo-item/list?dictType=AlarmMask')

// 获取公司树
export const getCompanyTreeAPI = params => request.get('/pvm-microservice-biz//organization/get', { params })

export const getNewCompanyTreeapi=()=>request.get('/sst-microservice-biz/sst/tree/company/tree')